﻿// ReSharper disable InconsistentNaming
using System;
using CI.Organism;
using NUnit.Framework;

namespace Mesopotamia.UnitTests.Organism
{
    [TestFixture]
    public class SynapseIOTests
    {
        private SynapseIO _synapseIO;
        private const int fireValue = 100;

        [SetUp]
        public void Setup()
        {
            _synapseIO = new SynapseIO("bindingName", "shortName", "description", Guid.NewGuid());
        }

        [Test]
        public void FireInput_ValueSet_Equal()
        {
            Assert.AreEqual(0, _synapseIO.CurrentDisplayValue);
            _synapseIO.FireInput(fireValue);
            Assert.AreEqual(fireValue, _synapseIO.CurrentDisplayValue);
        }

        [Test]
        public void Reset_CurrentValueCleared_Equal()
        {
            Assert.AreEqual(0, _synapseIO.CurrentDisplayValue);

            _synapseIO.Reset(1);

            _synapseIO.FireInput(fireValue);
            Assert.AreEqual(fireValue, _synapseIO.CurrentDisplayValue);

            _synapseIO.Reset(3);
            Assert.AreEqual(0, _synapseIO.CurrentDisplayValue);
        }
    }
}
